In the related art, there is provided a structure in which the respective internal time information of apparatuses which are connected over a network are synchronized, and IEEE 1588 PTP (Precision Time Protocol) has been known as a representative thereof (for example, refer to JP-A-2010-190635).
According to IEEE 1588 PTP, by transmitting PTP messages between a master machine (hereinafter, referred to as “PTP master”) and a slave machine (hereinafter, referred to as “PTP slave”) which are connected over a network, it is possible to synchronize the time information of a PTP slave with the time information of a PTP master with a high sub-μ sec precision. In detail, an internal oscillation frequency f2 of the PTP slave is synchronized with an internal oscillation frequency f1 of the PTP master, and, thereafter, the time information of the PTP slave is synchronized with the time information of the PTP master.
Hereinafter, a process of synchronizing the internal oscillation frequency f2 of the PTP slave with the internal oscillation frequency f1 of the PTP master is called frequency synchronization, and a process of synchronizing the time information of the PTP slave with the time information of the PTP master is called time synchronization.
FIG. 1 illustrates an overview of a high-precision time synchronization process using IEEE 1588 PTP according to the related art.
The PTP master transmits Sync message which functions as a PTP message including a transmission time T1i which is the time information of the PTP master on the network during a predetermined period Δm based on the oscillation frequency f1. Meanwhile, the PTP slave extracts the transmission time T1i included in Sync message in response to the reception of Sync message which is transmitted from the PTP master, and reads a reception time T2i which is the time information of the PTP slave. That is, the PTP slave acquires the transmission time T1i and the reception time T21 whenever a Sync packet is received.
In addition, the PTP slave transmits Delay_req message which functions as a PTP message to the PTP master over the network, and reads a transmission time T3 which is the time information of the PTP slave. Meanwhile, the PTP master reads a reception time T4 which is the time information of the PTP master in response to the reception of Delay_req message, and transmits Delay_res message, which functions as a PTP message including the reception time T4, to the PTP slave as a reply. Therefore, the PTP slave acquires the transmission time T3 of Delay_req message from the PTP slave and the reception time T4 of the PTP master by transmitting Delay_req message and receiving Delay_res message which is the answer in response to Delay_req message.
Here, it is assumed that a time which a necessary for the transmission of PTP messages, such as Sync message, Delay_req message, and Delay_res message, over the network (hereinafter, referred to as a “network delay time”) is not changed and is usually uniform.
Under this assumption, if the oscillation frequency f1 of the PTP master is equal to the oscillation frequency f2 of the PTP slave, the transmission interval of Sync message of the PTP master Δm=T12−T11 is equal to the reception interval of Sync message of the PTP slave Δs=T22−T21. In other words, in a case in which the difference between Δm and Δs, that is, Δm−Δs is not 0, the case can be said that there are errors between the oscillation frequency f1 of the PTP master and the oscillation frequency f2 of the PTP slave, thus oscillation frequencies are not synchronized.
Therefore, with respect to the frequency synchronization, the oscillation frequency f2 of the PTP slave may be adjusted such that the difference between Δm and Δs, that is, Δm−Δs (hereinafter, referred to as “frequency deviation”) is 0 in the PTP slave. The frequency deviation Δm−Δs is calculated using the following Equation 1.Frequency deviation Δm−Δs=(T12−T11)−(T22−T21)=(T21−T11)−(T22−T12)  (1)
With respect to the time synchronization, time difference shown in Equation 4 may be calculated based on the transmission time T12 and the reception time T22 of Sync message and the transmission time T3 and the reception time T4 of Delay_req message in the PTP slave, and an internal clock T2 may be adjusted such that the time difference is 0 in the PTP slave.Network delay of Sync message=(T22−time difference)−T12=(T22−T12)−time difference  (2)Network delay of Delay_req message=T4−(T3−time difference)=(T4−T3)+time difference  (3)
It is assumed that the network delay of Sync message=the network delay of Delay_req message=uniform. Therefore, with respect to the time difference, subsequent Equation 4 is derived by subtracting Equation 3 from Equation 2.Time difference={(T22−T12)−(T4−T3)}/2  (4)
In addition, with respect to the network delay, subsequent Equation 5 is derived by adding Equation 2 to Equation 3.Network delay={(T22−T12)+(T4−T3)}/2  (5)